//
//  DDButton.m
//  QQZone
//
//  Created by 树清吴 on 2017/10/18.
//  Copyright © 2017年 shuQingWu. All rights reserved.
//

#import "DDButton.h"
#import "UIView+SetFrame.h"

@implementation DDButton

- (void)layoutSubviews{
    [super layoutSubviews];
    
    
    if (DDPortrait) {
        self.imageView.frame = self.bounds;
        self.imageView.contentMode = UIViewContentModeCenter;
        self.titleLabel.hidden = YES;
    }else{
        self.imageView.contentMode = UIViewContentModeCenter;

        self.imageView.width = self.width * 0.4;
        self.imageView.height = self.height;
        self.imageView.x = 0;
        self.imageView.y = 0;
        
        self.titleLabel.hidden = NO;
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        self.titleLabel.x = self.imageView.width;
        self.titleLabel.y = 0;
        self.titleLabel.width = self.width - self.imageView.width;
        self.titleLabel.height = self.height;
    }
    
}

@end
